/*
 * @Author: DUST
 * @Date: 2023-06-20 09:30:24
 * @LastEditors: DUST
 * @LastEditTime: 2023-06-20 15:26:04
 * @FilePath: \national-standard-platform-alarm-screen\src\utils\ckThree\orbitcontrols.js
 * @Description: 
 * undefined
 */

import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
const initControl = (renderer, camera) => {
  const control = new OrbitControls(camera, renderer.domElement);
  control.enableDamping = true;
  // control.minZoom = 0.5;
  // control.maxZoom = 1;

  //相机距离观察目标点极小距离——模型最大状态
  control.minDistance = 10;
  //相机距离观察目标点极大距离——模型最小状态
  control.maxDistance = 500;
  control.minPolarAngle = 0;
  control.maxPolarAngle = Math.PI / 2;

  control.target.set(
    116.06660649914546,
    11.451555416873422,
    -19.41447193951761
  ); // 致远中学控制器target值

  control.update(); // 更新相机

  return control;
}

export default initControl;